<?php
include($classes_path.'/class.postDetails.php');
include($classes_path.'/class.slideViewer.php');
include($includes_path.'/pregReplace.inc.php');
$pagepost = new postDetails();
$gallery = new slideViewer();
$pagepost->set_id($article);
$pagepost->set_page($pageid);
$rowName = "gallery";
$path = "../../content/data/images/posts";
$gallery = $gallery->get_gallery($rowName, $article, $path);

if($pagepost->check_id() == true && $pagepost->check_draft() == true){
    print('<h1>'.$pagepost->get_title().'</h1>');
        if($_SESSION['adminrights'] == true) {
        print('<p class="nomarg"><a href="page/8/admin/apage/edit/epage/2/article/'.$article.'">Edit</a> | <a href="../includes/delete.inc.php?pageid=2&article='.$article.'" onclick="javascript:return confirm('.$delPromt.')">Delete</a></p>');
    }
    print('<p><span class="smallGrey">By <a class="blacknbold" href="page/7/community/user/'.$pagepost->get_authorId().'/'.$pagepost->get_realAuthor().'">'.ucfirst($pagepost->get_author()).'</a> on '.$pagepost->get_date().' | Category: '.$pagepost->get_category().'</span></p>');
    print('<p><span class="bold">'.$pagepost->get_summary().'</span></p>');

    if(!empty($gallery)){
    ?>
        <div id="myGallery" class="svw">
        <ul>
        <?php
            print($gallery);
            ?>
        </ul>
        </div>
    <?php
    }

     print('<p>'.nl2br(preg_replace($osorig, $osrw, $pagepost->get_body(), 2)).'</p>');
     if($pagepost->get_links() != ""){ ?>
        <ul class="inline">
            <?php
                print($pagepost->get_links());
            ?>
        </ul>
    <?php } ?>
    
    <?php if($pagepost->get_tags() != ""){ ?>
<div class="separator"></div>
        <ul class="inline">
        <li><span class="grey"><b>Tags: </b></span></li>
            <?php
                print(strtolower($pagepost->get_tags()));
            ?>
        </ul>
    <?php } ?>

    <ul class="nextprev">
        <?php
            print($pagepost->get_next());
            print($pagepost->get_prev());
        ?>
    </ul>
<?php }
else{
?>
    <h1>Oops! we can not seem to find the page you are looking for</h1>
    <p>Might we interest you with <a href="../news">something else</a>?</p>
<?php }
add_banner();
?>
